import request from '@/utils/request'

/**
 * 登录
 * @param {object} loginForm 登陆表单对象
 * @returns Promise
 */
export const loginAPI = (loginForm) => {
  return request({
    url: '/sys/login',
    method: 'POST',
    data: loginForm
  })
}

/**
 * 获取用户基本资料(目的：得到用户id)
 * @param {*} params
 * @returns Promise
 */
export const getUserProfileAPI = () => {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}

/**
 *根据用户id获取用户信息
 * @param {String} userId 用户id
 * @returns Promise
 */
export const getUserInfoAPI = (userId) => {
  return request({
    url: `/sys/user/${userId}`,
    method: 'get'
  })
}
